
#ifndef SX_QSQUARE_FRAME_LAYOUT_H
#define SX_QSQUARE_FRAME_LAYOUT_H

/* Qt Includes */
#include <QSplitter>

/* Sx Library Includes */
#include <sxQViewportFrameLayout.h>
#include <sxQViewportFrame.h>

namespace Sx {
namespace QtInterface {

/*
 * Defines a simple square viewport layout with 4 viewports. The layout of the
 * viewports is shown below:
 * 
 *   ---------------
 *   |  V0  |  V1  |
 *   ---------------
 *   |  V2  |  V3  |
 *   ---------------
 *
 * The number of required viewports is 4. Once they have been allocated they can
 * be used by this viewport by calling the setViewportFrames(..) function.
 */
class QSquareFrameLayout : public QViewportFrameLayout {
	Q_OBJECT

public:
	QSquareFrameLayout(QWidget* parent = nullptr);
	virtual ~QSquareFrameLayout();
	
	unsigned int getRequiredViewportCount() const;
	bool setViewportFrames(const Util::ArrayList<QViewportFrame*>& viewports);

protected:
	/*
	 * These splitters define the overall layout of this ViewportLayout.
	 * The three splitters divide the screen space into four squares thus
	 * providing an initial square layout.
	 * 
	 * POINTER_OWNERSHIP: NO (Qt Handles QWidgets)
	 */
	QSplitter* vSplitterHigh;
	QSplitter* vSplitterLow;
	QSplitter* hSplitter;
};

}

}

#endif
